//
//  GPGlobalConstant.swift
//  SeaTransportManage
//
//  Created by guopengwen on 2021/11/26.
//

import Foundation
import UIKit

let kScreenWidth = UIScreen.main.bounds.size.width
let kScreenHeight = UIScreen.main.bounds.size.height
let isShortScreen = kScreenHeight < 675
let kSystemVersion = (UIDevice.current.systemVersion as  NSString).floatValue

func relativeHeight(w: CGFloat, h: CGFloat) -> CGFloat {
    let relH = (kScreenWidth * h) / w;
    return relH
}

func COLOR_HEX(hexString: String, alpha: Float) -> UIColor {
    return UIColor.init(hexString: hexString, alpha: alpha)
}

func CGCOLOR_HEX(_ hexString: String, _ alpha: Float) -> CGColor {
    return COLOR_HEX(hexString: hexString, alpha: 1).cgColor
}

func COLOR_IMAGE(_ hexString: String, _ alpha: Float) -> UIImage {
    let color = COLOR_HEX(hexString: hexString, alpha: alpha)
    let image = UIImage(color: color)
    return image
}

let kIsProductEnv = true
let kServiceHost = kIsProductEnv ? "https://srop.epuyun.com" : "http://goods.devfan.site"

let kNavBarBackgroundColor = "#008CFF"
